<?php echo open_form(); ?>

	<fieldset>
		<legend>Basic Information</legend>
		<p><label for="project_name">Project Name</label> <input type="text" name="project_name" id="project_name" value="<?php echo set_value('project_name'); ?>"/></p>
		<div class="form_error"><?php echo form_error('project_name'); ?></div>

		<p><label for="project_slug">Project Slug</label> <input type="text" name="project_slug" id="project_slug" value="<?php echo set_value('project_slug'); ?>"/></p>
		<div class="form_error"><?php echo form_error('project_slug'); ?></div>

		<p><label for="project_notes">Project Notes</label> <textarea name="project_notes" id="project_notes"><?php echo set_value('project_notes'); ?></textarea></p>
		<div class="form_error"><?php echo form_error('project_notes'); ?></div>
	</fieldset>

	<fieldset>
		<legend>Managers and Users</legend>

		<p>
			<label for="proj_managers">Project Managers</label>
			<?php echo form_multiselect('proj_managers[]', $complete_user_list, set_value('proj_managers'), "id='proj_managers'"); ?>
		</p>
		<div class="form_error"><?php echo form_error('proj_managers'); ?></div>

		<p>
			<label for="proj_developers">Project Developers</label>
			<?php echo form_multiselect('proj_developers[]', $complete_user_list, set_value('proj_managers'), "id='proj_developers'"); ?>
		</p>
		<div class="form_error"><?php echo form_error('proj_developers'); ?></div>
	</fieldset>

	<fieldset>
		<legend>Project URL's</legend>
		<p><label for="main_url">Project Main URL</label> <input type="text" name="main_url" id="main_url" value="<?php echo set_value('main_url'); ?>" /></p>
		
		<p>Other Project URL's go here...</p>
	</fieldset>

	<fieldset>
		<legend>Version Control</legend>

		<p><label for="vcs_type">Version Control Type:</label> <?php echo form_dropdown('vcs_type', $vcs_types, set_value('vcs_type'), "id='vcs_type'"); ?></p>
		<div class="form_error"><?php echo form_error('vcs_type'); ?></div>

		<p><label for="vcs_url">Version Control URL:</label> <input type="text" name="vcs_url" id="vcs_url" value="<?php echo set_value('vcs_url'); ?>" /></p>
		<div class="form_error"><?php echo form_error('vcs_url'); ?></div>
	</fieldset>

	<fieldset>
		<legend>Developer Options</legend>
		<p><?php echo form_yesno('allow_devs_manage_tix', set_value('allow_devs_manage_tix')); ?> <label for="allow_devs_manage_tix">Allow Developers to Manage Tickets</label></p>
		<div class="form_error"><?php echo form_error('allow_devs_manage_tix'); ?></div>

		<p><?php echo form_yesno('allow_devs_manage_users', set_value('allow_devs_manage_users')); ?> <label for="allow_devs_manage_users">Allow Developers to Manage Users</label></p>
		<div class="form_error"><?php echo form_error('allow_devs_manage_users'); ?></div>

		<p><?php echo form_yesno('allow_mgrs_manage_settings', set_value('allow_mgrs_manage_settings')); ?> <label for="allow_mgrs_manage_settings">Allow Project Managers to Manage Project Settings</label></p>
		<div class="form_error"><?php echo form_error('allow_mgrs_manage_tix'); ?></div>

		<p><?php echo form_yesno('allow_mgrs_manage_users', set_value('allow_mgrs_manage_users')); ?> <label for="allow_mgrs_manage_users">Allow Project Managers to Manage Users</label></p>
		<div class="form_error"><?php echo form_error('allow_mgrs_manage_users'); ?></div>

		<p><?php echo form_yesno('allow_mgrs_add_notes', set_value('allow_mgrs_add_notes')); ?> <label for="allow_mgrs_add_notes">Allow Project Managers to Manage Notes</label></p>
		<div class="form_error"><?php echo form_error('allow_mgrs_add_notes'); ?></div>		

		<p><?php echo form_yesno('allow_devs_add_notes', set_value('allow_devs_add_notes')); ?> <label for="allow_devs_add_notes">Allow Developers to Add Notes</label></p>
		<div class="form_error"><?php echo form_error('allow_devs_add_notes'); ?></div>
	</fieldset>

	<fieldset>
		<legend>Activity Feed</legend>

		<table>
			<thead>
				<tr>
					<th>Source</th>
					<th>Public</th>
					<th>Private</th>
					<th>Project Members Only</th>
					<th>Off</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>VCS Commits</td>
					<td><?php echo form_radio('vcs_commits', 'public', set_radio('vcs_commits', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('vcs_commits', 'private', set_radio('vcs_commits', 'private')); ?></td>
					<td><?php echo form_radio('vcs_commits', 'project_members_only', set_radio('vcs_commits', 'project_members_only')); ?></td>
					<td><?php echo form_radio('vcs_commits', 'off', set_radio('vcs_commits', 'off')); ?></td>
				</tr>
				<tr>
					<td>Developers/Managers Ticket Updates</td>
					<td><?php echo form_radio('developer_ticket_updates', 'public', set_radio('developer_ticket_updates', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('developer_ticket_updates', 'private', set_radio('developer_ticket_updates', 'private')); ?></td>
					<td><?php echo form_radio('developer_ticket_updates', 'project_members_only', set_radio('developer_ticket_updates', 'project_members_only')); ?></td>
					<td><?php echo form_radio('developer_ticket_updates', 'off', set_radio('developer_ticket_updates', 'off')); ?></td>
				</tr>
				<tr>
					<td>API Ticket Updates</td>
					<td><?php echo form_radio('api_ticket_updates', 'public', set_radio('api_ticket_updates', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('api_ticket_updates', 'private', set_radio('api_ticket_updates', 'private')); ?></td>
					<td><?php echo form_radio('api_ticket_updates', 'project_members_only', set_radio('api_ticket_updates', 'project_members_only')); ?></td>
					<td><?php echo form_radio('api_ticket_updates', 'off', set_radio('api_ticket_updates', 'off')); ?></td>
				</tr>
				<tr>
					<td>Public Ticket Updates</td>
					<td><?php echo form_radio('public_ticket_updates', 'public', set_radio('public_ticket_updates', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('public_ticket_updates', 'private', set_radio('public_ticket_updates', 'private')); ?></td>
					<td><?php echo form_radio('public_ticket_updates', 'project_members_only', set_radio('public_ticket_updates', 'project_members_only')); ?></td>
					<td><?php echo form_radio('public_ticket_updates', 'off', set_radio('public_ticket_updates', 'off')); ?></td>
				</tr>
				<tr>
					<td>Project Notes</td>
					<td><?php echo form_radio('project_notes', 'public', set_radio('project_notes', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('project_notes', 'private', set_radio('project_notes', 'private')); ?></td>
					<td><?php echo form_radio('project_notes', 'project_members_only', set_radio('project_notes', 'project_members_only')); ?></td>
					<td><?php echo form_radio('project_notes', 'off', set_radio('project_notes', 'off')); ?></td>
				</tr>
				<tr>
					<td><input type="text" name="cf_1_url" id="cf_1_url" value="<?php echo set_value('cf_1_url'); ?>" /></td>
					<td><?php echo form_radio('cf_1', 'public', set_radio('cf_1', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('cf_1', 'private', set_radio('cf_1', 'private')); ?></td>
					<td><?php echo form_radio('cf_1', 'project_members_only', set_radio('cf_1', 'project_members_only')); ?></td>
					<td><?php echo form_radio('cf_1', 'off', set_radio('cf_1', 'off')); ?></td>
				</tr>
				<tr>
					<td><input type="text" name="cf_2_url" id="cf_2_url" value="<?php echo set_value('cf_2_url'); ?>" /></td>
					<td><?php echo form_radio('cf_2', 'public', set_radio('cf_2', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('cf_2', 'private', set_radio('cf_2', 'private')); ?></td>
					<td><?php echo form_radio('cf_2', 'project_members_only', set_radio('cf_2', 'project_members_only')); ?></td>
					<td><?php echo form_radio('cf_2', 'off', set_radio('cf_2', 'off')); ?></td>
				</tr>
				<tr>
					<td><input type="text" name="cf_3_url" id="cf_3_url" value="<?php echo set_value('cf_3_url'); ?>" /></td>
					<td><?php echo form_radio('cf_3', 'public', set_radio('cf_3', 'public', TRUE)); ?></td>
					<td><?php echo form_radio('cf_3', 'private', set_radio('cf_3', 'private')); ?></td>
					<td><?php echo form_radio('cf_3', 'project_members_only', set_radio('cf_3', 'project_members_only')); ?></td>
					<td><?php echo form_radio('cf_3', 'off', set_radio('cf_3', 'off')); ?></td>
				</tr>
			</tbody>
		</table>

		<div class="form_error"><?php echo form_error('vcs_commits'); ?></div>
		<div class="form_error"><?php echo form_error('developer_ticket_updates'); ?></div>
		<div class="form_error"><?php echo form_error('api_ticket_updates'); ?></div>
		<div class="form_error"><?php echo form_error('public_ticket_updates'); ?></div>
		<div class="form_error"><?php echo form_error('project_notes'); ?></div>
		<div class="form_error"><?php echo form_error('cf_1_url'); ?></div>
		<div class="form_error"><?php echo form_error('cf_2_url'); ?></div>
		<div class="form_error"><?php echo form_error('cf_3_url'); ?></div>

	</fieldset>

	<fieldset>
		<legend>Activated?</legend>
		<p>
			<label for="deactivated">Make this project available for people work on immediately?</label>
			<?php echo form_radio('deactivated', '0', set_radio('deactivated', '0', TRUE)); ?> Yes
			<?php echo form_radio('deactivated', '1', set_radio('deactivated', '1')); ?> No
		</p>
		<div class="form_error"><?php echo form_error('deactivated'); ?></div>
	</fieldset>


	<fieldset class="form_submit_area">
		<legend>Submit</legend>
		<button type="submit">Submit &raquo;</button>
	</fieldset>

</form>